﻿using System;
using System.IO;

namespace Entities
{
    [Serializable]
    public class HangHoa
    {
        private string hanhDong;
        private int hangHoaID;
        private string maHangHoa;
        private string maNhomHang;
        private string tenNhomHang;
        private string maLoai;
        private string tenLoai;
        private string tenHangHoa;
        private string maDonViTinh;
        private string tenDonViTinh;
        private string giaNhap;
        private string giaBanBuon;
        private string giaBanLe;
        private string maThue;
        private string giaTriThue;
        private string mucDatHang;
        private string mucTonToiThieu;
        private string linkImage;
        private string linkImageRoot;
        private byte[] images;
        private System.Drawing.Image picture;
        private string ghiChu;
        private bool deleted;
        private int soLuong;
        private bool khuyenMai;
        Entities.TaiKhoan taiKhoan;
        private string phantrankhuyenmai;

        public string Phantrankhuyenmai
        {
            get { return phantrankhuyenmai; }
            set { phantrankhuyenmai = value; }
        }

        public Entities.TaiKhoan TaiKhoan
        {
            get { return this.taiKhoan; }
            set
            {
                this.taiKhoan = value;
            }
        }
        public HangHoa()
        { }
        public HangHoa(string maHangHoa)
        {
            this.maHangHoa = maHangHoa;
        }
        public HangHoa(string maLoai,string tenLoai,int hangHoaID, string maHangHoa, string maNhomHang, string tenNhomHang, string tenHangHoa, string maDonViTinh, 
            string tenDonViTinh, string giaNhap, string giaBanBuon, string giaBanLe, string maThue, string giaTriThue,
            string mucDatHang, string mucTonToiThieu, string linkImage, string ghiChu, bool deleted,Entities.TaiKhoan taiKhoan)
        {
            this.maLoai = maLoai;
            this.tenLoai = tenLoai;
            this.taiKhoan = taiKhoan;
            this.hangHoaID = hangHoaID;
            this.maHangHoa = maHangHoa;
            this.maNhomHang = maNhomHang;
            this.tenNhomHang = tenNhomHang;
            this.tenHangHoa = tenHangHoa;
            this.maDonViTinh = maDonViTinh;
            this.tenDonViTinh = tenDonViTinh;
            this.giaNhap = giaNhap;
            this.giaBanBuon = giaBanBuon;
            this.giaBanLe = giaBanLe;
            this.maThue = maThue;
            this.giaTriThue = giaTriThue;
            this.mucDatHang = mucDatHang;
            this.mucTonToiThieu = mucTonToiThieu;
            this.linkImage = linkImage;
            this.ghiChu = ghiChu;
            this.deleted = deleted;
        }

        public HangHoa(int hangHoaID, string maHangHoa, string maNhomHang, string tenNhomHang, 
            string tenHangHoa, string maDonViTinh, string giaNhap, string giaBanBuon, string giaBanLe,
            string maThue,string giaTriThue, string mucDatHang, string mucTonToiThieu, string linkImage, string ghiChu, 
            bool deleted,bool khuyenMai)
        {
            this.khuyenMai = khuyenMai;
            this.hangHoaID = hangHoaID;
            this.maHangHoa = maHangHoa;
            this.maNhomHang = maNhomHang;
            this.tenNhomHang = tenNhomHang;
            this.tenHangHoa = tenHangHoa;
            this.maDonViTinh = maDonViTinh;
            this.giaNhap = giaNhap;
            this.giaBanBuon = giaBanBuon;
            this.giaBanLe = giaBanLe;
            this.maThue = maThue;
            this.giaTriThue = giaTriThue;
            this.mucDatHang = mucDatHang;
            this.mucTonToiThieu = mucTonToiThieu;
            this.linkImage = linkImage;
            this.ghiChu = ghiChu;
            this.deleted = deleted;
        }
        public HangHoa(string hanhdong,int hangHoaID, string maHangHoa, string maNhomHang, string tenNhomHang,
            string tenHangHoa, string maDonViTinh,string tendonvitinh, string giaNhap, string giaBanBuon, string giaBanLe,
            string maThue, string giaTriThue, string mucDatHang, string mucTonToiThieu, string linkImage, string ghiChu,
            bool deleted)
        {
            this.hanhDong = hanhdong;
            this.hangHoaID = hangHoaID;
            this.maHangHoa = maHangHoa;
            this.maNhomHang = maNhomHang;
            this.tenNhomHang = tenNhomHang;
            this.tenHangHoa = tenHangHoa;
            this.maDonViTinh = maDonViTinh;
            this.tenDonViTinh = tendonvitinh;
            this.giaNhap = giaNhap;
            this.giaBanBuon = giaBanBuon;
            this.giaBanLe = giaBanLe;
            this.maThue = maThue;
            this.giaTriThue = giaTriThue;
            this.mucDatHang = mucDatHang;
            this.mucTonToiThieu = mucTonToiThieu;
            this.linkImage = linkImage;
            this.ghiChu = ghiChu;
            this.deleted = deleted;
        }
        public string HanhDong
        {
            get { return hanhDong; }
            set { hanhDong = value; }
        }
        public int HangHoaID
        {
            get { return this.hangHoaID; }
            set
            {
                this.hangHoaID = value;
            }
        }
        public string MaHangHoa
        {
            get { return this.maHangHoa; }
            set
            {
                this.maHangHoa = value;
            }
        }
        public string MaLoai
        {
            get { return this.maLoai; }
            set
            {
                this.maLoai = value;
            }
        }
        public string TenLoai
        {
            get { return this.tenLoai; }
            set
            {
                this.tenLoai = value;
            }
        }
        public string MaNhomHang
        {
            get { return this.maNhomHang; }
            set
            {
                this.maNhomHang = value;
            }
        }
        public string TenNhomHang
        {
            get { return this.tenNhomHang; }
            set
            {
                this.tenNhomHang = value;
            }
        }
        public string TenHangHoa
        {
            get { return this.tenHangHoa; }
            set
            {
                this.tenHangHoa = value;
            }
        }
        public string MaDonViTinh
        {
            get { return this.maDonViTinh; }
            set
            {
                this.maDonViTinh = value;
            }
        }

        public string TenDonViTinh
        {
            get { return tenDonViTinh; }
            set { tenDonViTinh = value; }
        }
        public string GiaNhap
        {
            get { return this.giaNhap; }
            set
            {
                this.giaNhap = value;
            }
        }
        public string GiaBanBuon
        {
            get { return this.giaBanBuon; }
            set { this.giaBanBuon = value; }
        }
        public string GiaBanLe
        {
            get { return this.giaBanLe; }
            set { this.giaBanLe = value; }
        }
        public string MaThue
        {
            get { return this.maThue; }
            set
            {
                this.maThue = value;
            }
        }
        public string GiaTriThue
        {
            get { return this.giaTriThue; }
            set
            {
                this.giaTriThue = value;
            }
        }
        public string MucDatHang
        {
            get { return this.mucDatHang; }
            set { this.mucDatHang = value; }
        }
        public string MucTonToiThieu
        {
            get { return this.mucTonToiThieu; }
            set { this.mucTonToiThieu = value; }
        }
        public string LinkImage
        {
            get { return this.linkImage; }
            set { this.linkImage = value; }
        }

        public string LinkImageRoot
        {
            get { return linkImageRoot; }
            set { linkImageRoot = value; }
        }
        public byte[] Images
        {
            get { return images; }
            set { images = value; }
        }
        public System.Drawing.Image Picture
        {
            get { return picture; }
            set { picture = value; }
        }
        public string GhiChu
        {
            get { return this.ghiChu; }
            set { this.ghiChu = value; }
        }
        public bool Deleted
        {
            get { return this.deleted; }
            set { this.deleted = value; }
        }


        public bool Equals(HangHoa obj)
        {
            if (this.maHangHoa != obj.MaHangHoa)
                return false;
                
            if(this.maNhomHang != obj.MaNhomHang){return false;}
            if(this.tenNhomHang != obj.TenNhomHang){return false;}
            if(this.tenHangHoa != obj.TenHangHoa){return false;}
            if(this.maDonViTinh != obj.MaDonViTinh){return false;}
            if(this.giaNhap != obj.GiaNhap){return false;}
            if(this.giaBanBuon != obj.GiaBanBuon){return false;}
            if(this.giaBanLe != obj.GiaBanLe){return false;}
            if(this.maThue != obj.MaThue){return false;}
            if (this.giaTriThue != obj.GiaTriThue) { return false; }
            if(this.mucDatHang != obj.MucDatHang){return false;}
            if(this.mucTonToiThieu != obj.MucTonToiThieu){return false;}
            if(this.linkImage != obj.LinkImage){return false;}
            if(this.ghiChu != obj.GhiChu){return false;}
            if(this.deleted != obj.Deleted){return false;}
            return true;
        }

        public int SoLuong
        {
            get { return this.soLuong; }
            set { this.soLuong = value; }
        }
        public bool KhuyenMai
        {
            get { return this.khuyenMai; }
            set
            {
                this.khuyenMai = value;
            }
        }
    }
}